import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-09-21
 * Time: 14:48
 */
public class Test {
    public ArrayList<Integer> intersection (ArrayList<Integer> nums1, ArrayList<Integer> nums2) {
        ArrayList<Integer> list = new ArrayList<>();
        //创建哈希表,将nums数组里的所有元素放入
        HashSet<Integer> set = new HashSet<>(nums2);
        //遍历nums1,如果set里面包含该元素且list里不包含该元素,放入list
        for (int i = 0; i < nums1.size(); i++) {
            int ret = nums1.get(i);
            if(set.contains(ret) && !list.contains(ret)){
                list.add(ret);
            }
        }
        return list;
    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int left = in.nextInt();
        int right = in.nextInt();
        int count = 0;
        for (int cur = left; cur <= right; cur++) {
            int tmp2 = cur;
            while(tmp2 != 0){
                if(tmp2 % 10 == 2) {
                    count++;
                }
                tmp2 /= 10;
            }
        }
        System.out.println(count);
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = "abbc";
        boolean flag = true;
        while(flag == true){
            flag = true;
            int left = 0;
            int right = 1;
            String newStr = null;
            while(left < str.length() && right < str.length()){
                if(str.charAt(left) == str.charAt(right)){
                    left+=2;
                    right+=2;
                }else{
                    newStr += str.charAt(left);
                    left++;
                    right++;
                }
            }
        }
    }
}
